package com.dianping.cat.core.dal;

import org.unidal.dal.jdbc.DataField;
import org.unidal.dal.jdbc.QueryDef;
import org.unidal.dal.jdbc.QueryType;
import org.unidal.dal.jdbc.Readset;
import org.unidal.dal.jdbc.Updateset;
import org.unidal.dal.jdbc.annotation.Attribute;
import org.unidal.dal.jdbc.annotation.Entity;
import org.unidal.dal.jdbc.annotation.Variable;

@Entity(logicalName = "dailyreport", physicalName = "dailyreport", alias = "dr")
public class DailyReportEntity
{
  @Attribute(field = "id", nullable = false, primaryKey = true, autoIncrement = true)
  public static final DataField ID = new DataField("id");
  
  @Attribute(field = "name", nullable = false)
  public static final DataField NAME = new DataField("name");
  
  @Attribute(field = "ip", nullable = false)
  public static final DataField IP = new DataField("ip");
  
  @Attribute(field = "domain", nullable = false)
/* 25 */   public static final DataField DOMAIN = new DataField("domain");
  
  @Attribute(field = "period", nullable = false)
/* 28 */   public static final DataField PERIOD = new DataField("period");
  
  @Attribute(field = "type", nullable = false)
/* 31 */   public static final DataField TYPE = new DataField("type");
  
  @Attribute(field = "creation_date", nullable = false)
/* 34 */   public static final DataField CREATION_DATE = new DataField("creation-date");
  
  @Attribute(field = "", selectExpr = "COUNT(*)")
/* 37 */   public static final DataField COUNT = new DataField("count");
  
  @Variable
/* 40 */   public static final DataField KEY_ID = new DataField("key-id");
  
  @Variable
/* 43 */   public static final DataField START_DATE = new DataField("start-date");
  
  @Variable
/* 46 */   public static final DataField END_DATE = new DataField("end-date");
  
  @Variable
/* 49 */   public static final DataField LIMITS = new DataField("limits");

/* 51 */   public static final Readset<DailyReport> READSET_FULL = new Readset(new DataField[] { ID, NAME, IP, DOMAIN, PERIOD, TYPE, CREATION_DATE });

/* 53 */   public static final Readset<DailyReport> READSET_DOMAIN_NAME = new Readset(new DataField[] { DOMAIN, NAME });

/* 55 */   public static final Readset<DailyReport> READSET_COUNT = new Readset(new DataField[] { COUNT });

/* 57 */   public static final Updateset<DailyReport> UPDATESET_FULL = new Updateset(new DataField[] { ID, NAME, IP, DOMAIN, PERIOD, TYPE, CREATION_DATE });

/* 59 */   public static final QueryDef FIND_BY_PK = new QueryDef("findByPK", DailyReportEntity.class, QueryType.SELECT, "SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='id'/> = ${key-id}");


/* 62 */   public static final QueryDef INSERT = new QueryDef("insert", DailyReportEntity.class, QueryType.INSERT, "INSERT INTO <TABLE/> (<FIELDS/>) VALUES (<VALUES/>)");


/* 65 */   public static final QueryDef UPDATE_BY_PK = new QueryDef("updateByPK", DailyReportEntity.class, QueryType.UPDATE, "UPDATE <TABLE/> SET <FIELDS/> WHERE <FIELD name='id'/> = ${key-id}");


/* 68 */   public static final QueryDef DELETE_BY_PK = new QueryDef("deleteByPK", DailyReportEntity.class, QueryType.DELETE, "DELETE FROM <TABLE/> WHERE <FIELD name='id'/> = ${key-id}");


/* 71 */   public static final QueryDef FIND_BY_DOMAIN_NAME_PERIOD = new QueryDef("findByDomainNamePeriod", DailyReportEntity.class, QueryType.SELECT, "SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='period'/> = ${period} AND <FIELD name='domain'/> = ${domain} AND <FIELD name='name'/> = ${name} AND binary(<FIELD name='domain'/>) = binary(${domain})");


/* 74 */   public static final QueryDef DELETE_BY_DOMAIN_NAME_PERIOD = new QueryDef("deleteByDomainNamePeriod", DailyReportEntity.class, QueryType.DELETE, "DELETE FROM <TABLE/> WHERE <FIELD name='period'/> = ${period} AND <FIELD name='domain'/> = ${domain} AND <FIELD name='name'/> = ${name} AND binary(<FIELD name='domain'/>) = binary(${domain})");


/* 77 */   public static final QueryDef QUERY_LATEST_REPORTS_BY_DOMAIN_NAME = new QueryDef("queryLatestReportsByDomainName", DailyReportEntity.class, QueryType.SELECT, "SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='domain'/> = ${domain} AND <FIELD name='name'/> = ${name} AND binary(<FIELD name='domain'/>) = binary(${domain}) ORDER BY <FIELD name='id'/> DESC LIMIT ${limits}");
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-core-3.0.0.jar!/com/dianping/cat/core/dal/DailyReportEntity.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */